package com.csap.framework.oauth2.level;

import com.csap.framework.oauth2.cache.RedisCacheQueryRequest;
import com.csap.framework.oauth2.cache.RedisCacheUpdateRequest;
import com.csap.framework.oauth2.cache.StrategyType;

import java.util.function.Function;

/**
 * @Author ycf
 * @Date 2022/3/10 4:37 PM
 * @Version 1.0
 */
public interface RedisCache<T> extends RedisCacheQueryRequest<T>, RedisCacheUpdateRequest<T> {
    String KEY = "qxcx:ele:id:%S";
    String KEY_1 = "qxcx:ele:num:%S:%s";
    String GPS_KEY = "gps";
    String NUM = "num";
    String IMEL = "imel";

    @Override
    default StrategyType strategyType() {
        return null;
    }

    /**
     * 获取车辆id
     *
     * @param key          键
     * @param value        车辆编号/中控号
     * @param dataFunction 数据
     * @return 车辆id
     */
    Long getId(String key, String value, Function<String, Long> dataFunction);
}
